<template>
  <el-dialog :visible.sync="visible" v-dialogDrag :title="title" class="tl-dialog" width="1300px" @open="open" @close="close">
    <el-form class="tl-form" ref="form" :model="model" :rules="rules" label-width="150px" :disabled="disableEditSubmit">
      <el-row>
        <el-col :span="12">
          <el-form-item label="Tab编码" prop="code" :rules="rules.validateRequire">
            <el-input v-model="model.code" maxlength="85" style="width:100%" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="Tab名称" prop="name" :rules="rules.validateRequire">
            <el-input v-model="model.name" maxlength="85" style="width:100%" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="12">
          <el-form-item label="关联的数据" prop="relationdata" :rules="rules.validateRequire">
            <el-input v-model="model.relationdata" maxlength="85" style="width:100%" />
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="排序码" prop="sortcode" :rules="rules.validateRequire">
            <el-input v-model="model.sortcode" maxlength="85" style="width:100%" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="扩展1" :required="false">
            <el-input v-model="model.extendfield1" maxlength="85" style="width:100%" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="扩展2" :required="false">
            <el-input v-model="model.extendfield2" maxlength="85" style="width:100%" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="扩展3" :required="false">
            <el-input v-model="model.extendfield3" maxlength="85" style="width:100%" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="扩展4" :required="false">
            <el-input v-model="model.extendfield4" maxlength="85" style="width:100%" />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="备注">
            <textarea v-model="model.description" style="width:100%" rows="3" maxlength="330" />
            </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="24">
          <el-form-item label="有效" :rules="rules.validateRequire">
            <el-select v-model="model.enabled" placeholder="请选择">
              <el-option v-for="item in enabledList" :key="item.code" :label="item.name" :value="parseInt(item.code)" />
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button :type="disableEditSubmit === false ? 'text' : 'primary'" @click="doCancelEdit">取消</el-button>
      <el-button type="primary" @click="doSubmitEdit" :loading="saveLoading" v-if="disableEditSubmit === false">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
/** mixins */
import { mixin_edit } from '@tapui/mixins/mixin_edit'
import tlRefTreeModule from '@tapui/components/Tap/Ref/RefTree'
import { putAction, getAction, postAction } from '@tapui/utils/http'
export default {
  components: { tlRefTreeModule },
  mixins: [mixin_edit],
  data() {
    return {
      moduleTitle: 'APP关联页面',
      urlPrefix: '/app/appPageTab/',
      url: {}
    }
  },
  props: {
    catalog1List: {
      type: Array,
      default: function() {
        return []
      }
    },
    catalog2List: {
      type: Array,
      default: function() {
        return []
      }
    },
    catalog3List: {
      type: Array,
      default: function() {
        return []
      }
    },
    product_lineList: {
      type: Array,
      default: function() {
        return []
      }
    },
    enabledList: {
      type: Array,
      default: function() {
        return []
      }
    },
    pageid: {}
  },
  methods: {
    assignDefaultValue() {
      this.model.pageid = this.pageid
      // this.$refs.editForm.model.pageid = this.selectTreeNode.id
    }
  },
  watch: {
    'model.dispdept_code_array'(newVal, oldVal) {
      console.log(newVal)
    }
  }
}
</script>

<style lang="scss"></style>
